<?php session_start();?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="maintenancePagesCSS.css" />
        <title>Edit Product</title>
    <style type="text/css">

    </style></head>
    <body>
	
        <center>
		
          <form action="AddPartFunc.php"method="post" id="FormAddPart">
		  
              <table width="1000" height="395" background="images/background.jpg">
			  
              <tr>
                <th height="389" scope="col"><p><img src="images/TitleAddNewPart.gif" alt="Add New Part" width="514" height="67"></p>
                  <div align="center">
                    <table width="500" border="0" class="EditTable">
                    <tr>
                      <th bordercolor="#000000" bgcolor="#666666" scope="col"><align="center" bordercolor="#000000">
                                      
                    <tbody>
                                        <tr bordercolor="#000000" bgcolor="#666666" >
                                          <td> *Manufacturer:&nbsp </td>
                                          <td><input type="text" name="Manufacturer" value="" id="Manufacturer"/>                                          </td>
                                        </tr>
                                        <tr bordercolor="#000000" bgcolor="#666666">
                                          <td> *Model Number:&nbsp </td>
                                          <td><input type="text" name="ModelNo" value="" id="ModelNo"/>                                          </td>
                                        </tr>
                                        <tr bordercolor="#000000" bgcolor="#666666">
                                          <td> Serial Number:&nbsp </td>
                                          <td><input type="text" name="SerialNo" value="" id="SerialNo" />                                          </td>
                                        </tr>
                                        <tr bordercolor="#000000" bgcolor="#666666">
                                          <td> *Company Price:&nbsp </td>
                                          <td><input type="text" name="CompanyPrice" value="" id="CompanyPrice"/>                                          </td>
                                        </tr>
                                        <tr bordercolor="#000000" bgcolor="#666666">
                                          <td> *Customer Price:&nbsp </td>
                                          <td><input type="text" name="CustomerPrice" value="" id="CustomerPrice"/>                                          </td>
                                        </tr>
                                        <tr bordercolor="#000000" bgcolor="#666666">
                                          <td> Tech Notes:&nbsp </td>
                                          <td><input type="text" name="TechNotes" value="" />                                          </td>
                                        </tr>
                    </tbody>
                  </table>
                <p>
                  <input type="button" onclick ="submitAddPart();" value="Submit Query" name="BtnPartsAdd" />
&nbsp;
<input type="reset" value="Reset" name="BtnPartsReset" />
<br>
<br>
<br>
* Denotes Fields Required<BR><BR>
<script src="links.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
            writeProductLinks("", "");
        </script>
</div>
</th>
</tr>
</table>
</p></th>
                </tr>
                </table>
                <br/>
          </form>
            
        </center>
    </body>
    <script type="text/javascript">
        function submitAddPart()
        {
            var strCorrect = "Please correct the following errors:\n";
            var strCompare = strCorrect;
            strCorrect += checkFields();
            if(strCorrect == strCompare)
            {
               document.getElementById("FormAddPart").submit();
            }
            else
            {
                alert(strCorrect);
            }
        }
        
        function checkFields()
        {
            var str = "";        

            str += (isNaN(parseFloat(document.getElementById("CustomerPrice").value))) ? "  - Customer Price should be a number\n"
                    : "";

            str += (isNaN(parseFloat(document.getElementById("CompanyPrice").value))) ? "  - Company Price should be a number\n"
                    : "";

            str += (document.getElementById("Manufacturer").value == "") ? "  - Manufacturer Name is Blank\n" : "";

            str += (document.getElementById("ModelNo").value == "") ? "  - Model Number is Blank\n" : "";

            str += (document.getElementById("CompanyPrice").value == "") ? "  - Company Price is Blank\n" : "";

            str += (document.getElementById("CustomerPrice").value == "") ? "  - Customer Price is Blank\n" : "";

                

            return str;
        }
    </script>
</html>
